/**
 * Sample React Native App
 * https://github.com/facebook/react-native
 * @flow
 */

import React, {Component} from 'react';
import {
    Platform,
    StyleSheet,
    Text,
    Button,
    View
} from 'react-native';
import DBUtils, {PTest} from './data/filter/common/DBUtils'
import SQLite,{BookDB} from './data/filter/common/SQLiteUtils.js'
import Log from "./data/filter/common/Log";

let dBUtils = new DBUtils(PTest);
let mSQLite = new SQLite(BookDB);


export default class App extends Component {
    render() {
        return (
            <View style={styles.container}>
                <Button title={'写入'} onPress={() => {
                    mSQLite._insertUserData([{
                        name: '123123',
                        age: '18,',
                        sex: 'man',
                        phone: '15812345678',
                        email: 'sdf@163.com',
                        qq: '46465465'
                    }]);
                }}/>
                <Button title={'读取'} onPress={() => {
                    mSQLite._query((data) => {
                        alert(JSON.stringify(data));
                    });
                }}/>
                <Button title={'111'} onPress={() => {
                    Log.log('----------------------');
                    Log.log(mSQLite.dbInfo);
                }}/>
                <Text style={styles.welcome}>
                    Welcome to React Native!
                </Text>
                <Text style={styles.instructions}>
                    To get started, edit App.js
                </Text>
            </View>
        );
    }
}

const styles = StyleSheet.create({
    container: {
        flex: 1,
        justifyContent: 'center',
        alignItems: 'center',
        backgroundColor: '#F5FCFF',
    },
    welcome: {
        fontSize: 20,
        textAlign: 'center',
        margin: 10,
    },
    instructions: {
        textAlign: 'center',
        color: '#333333',
        marginBottom: 5,
    },
});
